package com.example.myblog1_0.controller;

import com.example.myblog1_0.service.ArticleService;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: xc
 * @Date: 2018/12/22 16:48
 * @Description:
 **/
@RestController
public class SuperAdminController {
    @Autowired
    ArticleService articleService;
    @GetMapping("/getArticleManagement")
    public JSONObject getArticleManagement(@RequestParam("rows") int rows, @RequestParam("pageNum") int currentPage){
        return articleService.getArticleManage(rows,currentPage);
    }
    @PostMapping("/deleteArticle")
    public JSONObject deleteArticle(@RequestParam("id") String id){
        return articleService.deleteArticleById(id);
    }
}
